

        <g:set var="entityName" value="${message(code: 'classes.label', default: 'Classes')}" />
            <g:form method="post" >
                <g:hiddenField name="id" value="${classesInstance?.id}" />
                <g:hiddenField name="version" value="${classesInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="level"><g:message code="classes.level.label" default="Level" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: classesInstance, field: 'level', 'errors')}">
                                    <g:if test="${School.get(session.school.id).level.toList().size() > 1}">
                                        <g:select class="select" name="level" from="${School.get(session.school.id).level.toList()}" value="${classesInstance.level}"/>
                                    </g:if>
                                    <g:else>
                                        ${School.get(session.school.id).level.toList().get(0)}
                                    </g:else>                                  
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="grade"><g:message code="classes.grade.label" default="Grade" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: classesInstance, field: 'grade', 'errors')}">
                                    <g:lookupSelect id="grade" name="grade" realm="grades" value="${classesInstance.grade}"/>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="team"><g:message code="classes.team.label" default="Team" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: classesInstance, field: 'team', 'errors')}">
                                    <g:lookupSelect id="team" name="team" realm="teams" value="${classesInstance.team}"/>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="master"><g:message code="classes.master.label" default="Master" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: classesInstance, field: 'master', 'errors')}">
                                    <g:select name="master.id" from="${peoples}" optionKey="id" value="${classesInstance?.master?.id}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="buildTime"><g:message code="classes.buildTime.label" default="Build Time" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: classesInstance, field: 'buildTime', 'errors')}">
                                    <%
                                    def buildTime = classesInstance.buildTime
                                    def showBuildTime;
                                    if(buildTime){
                                        showBuildTime = (buildTime.getYear()+1900).toString()+"-"+(buildTime.getMonth()+1).toString()+"-"+(buildTime.getDay()).toString()
                                    }
                                    %>
                                    <g:if test = "${showBuildTime}">
                                        <g:textField name="buildTime" value="${(buildTime.getYear()+1900).toString()+'-'+(buildTime.getMonth()+1).toString()+'-'+(buildTime.getDay()).toString()}"/>
                                    </g:if>
                                    <g:else>
                                        <g:textField name="buildTime" value="" readonly="true"/>
                                    </g:else>
                                    
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                </div>
            </g:form>
